<?php
class Notification_controller extends CI_Controller
{
	function __construct()
	{
		parent::__construct();
		$this->load->model('notification_model');
	}
	
	
	function index()
	{
		
	}
	
	
	function show_notification()
	{
		$data['title']="Notification";
		$data['id']="notification";
		$data['rows'] =$this->notification_model->get_all_notice();
		$data['main_content'] = 'show_notification_view';
		$this->load->view('header',$data);
		$this->load->view('show_notification_view', $data);
		$this->load->view('footer',$data);
	}
	
	
	function mark()
	{
		$profile['noticeid']= $this->input->get('info');
		$profile['is_read']=1;
		$this->notification_model->update($profile);
		redirect('notification_controller/show_notification');
	}

	
	function send_notice()
	{
		$this->notification_model->create_new_notice($this->input->get('notice_type'));
		redirect('feed_controller/index');
		/*if($this->input->get('notice_type')==1)
		{
			$this->load->view('feed_controller/index');
		}
		else if($this->input->get('notice_type')==2)
		{
			$this->load->view('feed_controller/index');
		}*/
	}
}
?>